// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import FastClick from 'fastclick'
import Vuex from 'vuex'
import Navigation from 'vue-navigation'
import createPersistedState from 'vuex-persistedstate' //vuex状态持久化
import { Toast, Indicator, MessageBox, Loadmore ,InfiniteScroll} from 'mint-ui';
import 'mint-ui/lib/style.css'//mint-ui css

import rem from './js/rem.js' // rem,Date.prototype
import http from './js/axios' // ajax
import Common from './js/util' // 全局方法属性
Vue.prototype.http = http
Vue.use(Common)
Vue.use(InfiniteScroll)

import commonStore from './vuex/commonStore.js' //Vuex 公用模块

// rem
Vue.use(Vuex)
Vue.use(Navigation, { router }) // router为路由文件
Vue.use(require('vue-wechat-title'))// 修改微信title
// Vue.use(animate)

//合并vuex
const store = new Vuex.Store({
  modules: {
    commonStore
  },
  plugins: [createPersistedState()]//会自动保存创建的状态。刷新还在
});

Vue.config.productionTip = false

FastClick.attach(document.body);

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
